﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Default.aspx.cs" Inherits="Web.View.d1011Menu.Default" %>
<%@ Register Assembly="Ext.Net" Namespace="Ext.Net" TagPrefix="ext" %> 
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title>d1011</title>
    <script src="/View/js/Alert.js" type="text/javascript"></script> 
    <script type="text/javascript">
        function SetWinData(index) {
            document.getElementById("Hid").value = d1011_MainStore.getAt(index).get('jgdm');
            
			Txtjgmc.setValue(d1011_MainStore.getAt(index).get('jgmc'));
			Txtzjdm.setValue(d1011_MainStore.getAt(index).get('zjdm'));
			Txtdsgx.setValue(d1011_MainStore.getAt(index).get('dsgx'));
			Txtzpdw.setValue(d1011_MainStore.getAt(index).get('zpdw'));
			Txtjjlx.setValue(d1011_MainStore.getAt(index).get('jjlx'));
			Txtjglb.setValue(d1011_MainStore.getAt(index).get('jglb'));
			Txtjgjb.setValue(d1011_MainStore.getAt(index).get('jgjb'));
			Txtshyl.setValue(d1011_MainStore.getAt(index).get('shyl'));
			Txttsdz.setValue(d1011_MainStore.getAt(index).get('tsdz'));
			Txtyzbm.setValue(d1011_MainStore.getAt(index).get('yzbm'));
			Txtdhhm.setValue(d1011_MainStore.getAt(index).get('dhhm'));
			Txtdzyx.setValue(d1011_MainStore.getAt(index).get('dzyx'));
			Txtclsj.setValue(d1011_MainStore.getAt(index).get('clsj'));
			Txthddb.setValue(d1011_MainStore.getAt(index).get('hddb'));
			Txtzzzj.setValue(d1011_MainStore.getAt(index).get('zzzj'));
			Txtwsgs.setValue(d1011_MainStore.getAt(index).get('wsgs'));
			Txtycws.setValue(d1011_MainStore.getAt(index).get('ycws'));
			Txtscws.setValue(d1011_MainStore.getAt(index).get('scws'));
			Txtrs.setValue(d1011_MainStore.getAt(index).get('rs'));
			Txtwjrs.setValue(d1011_MainStore.getAt(index).get('wjrs'));
			Txtkssl.setValue(d1011_MainStore.getAt(index).get('kssl'));
			Txtssdq.setValue(d1011_MainStore.getAt(index).get('ssdq'));
			Txtmzrs.setValue(d1011_MainStore.getAt(index).get('mzrs'));
			Txtchmzs.setValue(d1011_MainStore.getAt(index).get('chmzs'));
			Txtncys.setValue(d1011_MainStore.getAt(index).get('ncys'));
			Txtchcys.setValue(d1011_MainStore.getAt(index).get('chcys'));
			Txtnsr.setValue(d1011_MainStore.getAt(index).get('nsr'));
			Txtchnsr.setValue(d1011_MainStore.getAt(index).get('chnsr'));
			Txtsblx.setValue(d1011_MainStore.getAt(index).get('sblx'));
			Txtpzlx.setValue(d1011_MainStore.getAt(index).get('pzlx'));
			Txtpybm.setValue(d1011_MainStore.getAt(index).get('pybm'));
			Txtwbbm.setValue(d1011_MainStore.getAt(index).get('wbbm'));
			Txtqtbm.setValue(d1011_MainStore.getAt(index).get('qtbm'));

            d1011_Win.show();
        }
    </script>
</head>
<body>
    <form id="MainForm" runat="server">
    <ext:ResourceManager ID="MainResourceMgr" runat="server" />
    <!--用来导出到Excel的数据源-->
    <ext:Hidden ID="ExcelGridData" runat="server" />
    <!--d1011表页面主数据元，自动生成-->
    <ext:Store runat="server" ID="d1011_MainStore" OnRefreshData="d1011_DataBind" AutoLoad="true">
        <Proxy>
            <ext:PageProxy />
        </Proxy>
        <Reader>
            <ext:JsonReader IDProperty="jgdm">
                <Fields>
                    
					<ext:RecordField Name="jgdm" />
					<ext:RecordField Name="jgmc" />
					<ext:RecordField Name="zjdm" />
					<ext:RecordField Name="dsgx" />
					<ext:RecordField Name="zpdw" />
					<ext:RecordField Name="jjlx" />
					<ext:RecordField Name="jglb" />
					<ext:RecordField Name="jgjb" />
					<ext:RecordField Name="shyl" />
					<ext:RecordField Name="tsdz" />
					<ext:RecordField Name="yzbm" />
					<ext:RecordField Name="dhhm" />
					<ext:RecordField Name="dzyx" />
					<ext:RecordField Name="clsj" />
					<ext:RecordField Name="hddb" />
					<ext:RecordField Name="zzzj" />
					<ext:RecordField Name="wsgs" />
					<ext:RecordField Name="ycws" />
					<ext:RecordField Name="scws" />
					<ext:RecordField Name="rs" />
					<ext:RecordField Name="wjrs" />
					<ext:RecordField Name="kssl" />
					<ext:RecordField Name="ssdq" />
					<ext:RecordField Name="mzrs" />
					<ext:RecordField Name="chmzs" />
					<ext:RecordField Name="ncys" />
					<ext:RecordField Name="chcys" />
					<ext:RecordField Name="nsr" />
					<ext:RecordField Name="chnsr" />
					<ext:RecordField Name="sblx" />
					<ext:RecordField Name="pzlx" />
					<ext:RecordField Name="pybm" />
					<ext:RecordField Name="wbbm" />
					<ext:RecordField Name="qtbm" />

                </Fields>
            </ext:JsonReader>
        </Reader> 
        <BaseParams>
            <ext:Parameter Name="start" Value="0" Mode="Raw">
            </ext:Parameter>
            <ext:Parameter Name="limit" Value="15" Mode="Raw">
            </ext:Parameter>
        </BaseParams>
    </ext:Store>
    <!--d1011页面主表格-->
    <ext:Viewport ID="MainViewPort" runat="server">
        <Items>
            <ext:FitLayout>
                <Items>
                    <ext:GridPanel ID="d1011_Grid" Layout="fit" TrackMouseOver="true" runat="server" StoreID="d1011_MainStore"
                        StripeRows="true" Header="false" Border="false" Collapsible="true">
                        <TopBar>
                            <ext:Toolbar ID="MainToolBar" runat="server">
                                <Items>
                                    <ext:Button ID="BtnAdd" runat="server" Text="添加" Icon="Add">
                                        <Listeners>
                                            <Click Handler="#{d1011_MainForm}.getForm().reset();#{Hid}.setValue('');#{d1011_Win}.show();" />
                                        </Listeners>
                                    </ext:Button>
                                    <ext:Button ID="BtnDel" runat="server" Text="删除" Icon="Delete">
                                        <DirectEvents>
                                            <Click OnEvent="BtnDel_Click">
                                                <Confirmation ConfirmRequest="true" Title="确认" Message="确实要删除吗?" />
                                                <EventMask ShowMask="true" Msg="正在删除数据，请等候 ..." />
                                            </Click>
                                        </DirectEvents>
                                        <Listeners>
                                            <Click Handler="if(#{d1011_Grid}.getSelectionModel().getCount()<=0) {TellAlert('请选择要删除的记录');return false;}" />
                                        </Listeners>
                                    </ext:Button>
                                    <ext:ToolbarSeparator />
                                    <ext:Button ID="BtnReload" runat="server" Text="重新加载" Icon="Reload">
                                        <Listeners>
                                            <Click Handler="#{d1011_MainStore}.reload();" />
                                        </Listeners>
                                    </ext:Button>
                                    <ext:ToolbarFill />
                                    <ext:Button ID="BtnToExcel" runat="server" Text="To Excel" AutoPostBack="true" OnClick="BtnSaveToExcel"
                                        Icon="PageExcel">
                                        <Listeners>
                                            <Click Handler="#{ExcelGridData}.setValue(Ext.encode(d1011_Grid.getRowsValues(false)));" />
                                        </Listeners>
                                        <ToolTips>
                                            <ext:ToolTip Title="将当前页内容存储为Excel文件">
                                            </ext:ToolTip>
                                        </ToolTips>
                                    </ext:Button>
                                </Items>
                            </ext:Toolbar>
                        </TopBar>
                        <ColumnModel ID="d1011_ColumnMode" runat="server">
                            <Columns>
                                <ext:RowNumbererColumn Width="20" />
                                <ext:Column Header="主键" Sortable="true" Hidden="true" DataIndex="jgdm" />
                                
								<ext:Column Header="jgmc" Sortable="true" DataIndex="jgmc" />
								<ext:Column Header="zjdm" Sortable="true" DataIndex="zjdm" />
								<ext:Column Header="dsgx" Sortable="true" DataIndex="dsgx" />
								<ext:Column Header="zpdw" Sortable="true" DataIndex="zpdw" />
								<ext:Column Header="jjlx" Sortable="true" DataIndex="jjlx" />
								<ext:Column Header="jglb" Sortable="true" DataIndex="jglb" />
								<ext:Column Header="jgjb" Sortable="true" DataIndex="jgjb" />
								<ext:Column Header="shyl" Sortable="true" DataIndex="shyl" />
								<ext:Column Header="tsdz" Sortable="true" DataIndex="tsdz" />
								<ext:Column Header="yzbm" Sortable="true" DataIndex="yzbm" />
								<ext:Column Header="dhhm" Sortable="true" DataIndex="dhhm" />
								<ext:Column Header="dzyx" Sortable="true" DataIndex="dzyx" />
								<ext:Column Header="clsj" Sortable="true" DataIndex="clsj" />
								<ext:Column Header="hddb" Sortable="true" DataIndex="hddb" />
								<ext:Column Header="zzzj" Sortable="true" DataIndex="zzzj" />
								<ext:Column Header="wsgs" Sortable="true" DataIndex="wsgs" />
								<ext:Column Header="ycws" Sortable="true" DataIndex="ycws" />
								<ext:Column Header="scws" Sortable="true" DataIndex="scws" />
								<ext:Column Header="rs" Sortable="true" DataIndex="rs" />
								<ext:Column Header="wjrs" Sortable="true" DataIndex="wjrs" />
								<ext:Column Header="kssl" Sortable="true" DataIndex="kssl" />
								<ext:Column Header="ssdq" Sortable="true" DataIndex="ssdq" />
								<ext:Column Header="mzrs" Sortable="true" DataIndex="mzrs" />
								<ext:Column Header="chmzs" Sortable="true" DataIndex="chmzs" />
								<ext:Column Header="ncys" Sortable="true" DataIndex="ncys" />
								<ext:Column Header="chcys" Sortable="true" DataIndex="chcys" />
								<ext:Column Header="nsr" Sortable="true" DataIndex="nsr" />
								<ext:Column Header="chnsr" Sortable="true" DataIndex="chnsr" />
								<ext:Column Header="sblx" Sortable="true" DataIndex="sblx" />
								<ext:Column Header="pzlx" Sortable="true" DataIndex="pzlx" />
								<ext:Column Header="pybm" Sortable="true" DataIndex="pybm" />
								<ext:Column Header="wbbm" Sortable="true" DataIndex="wbbm" />
								<ext:Column Header="qtbm" Sortable="true" DataIndex="qtbm" />

                            </Columns>
                        </ColumnModel>
                        <Listeners>
                            <RowDblClick Handler="SetWinData(rowIndex);" />
                        </Listeners>
                        <Plugins>
                            <ext:GridFilters runat="server" FiltersText="查找" ID="d1011_Filter">
                                <Filters>
                                    
								<ext:StringFilter DataIndex="jgmc" />
								<ext:StringFilter DataIndex="zjdm" />
								<ext:StringFilter DataIndex="dsgx" />
								<ext:StringFilter DataIndex="zpdw" />
								<ext:StringFilter DataIndex="jjlx" />
								<ext:StringFilter DataIndex="jglb" />
								<ext:StringFilter DataIndex="jgjb" />
								<ext:StringFilter DataIndex="shyl" />
								<ext:StringFilter DataIndex="tsdz" />
								<ext:StringFilter DataIndex="yzbm" />
								<ext:StringFilter DataIndex="dhhm" />
								<ext:StringFilter DataIndex="dzyx" />
								<ext:StringFilter DataIndex="clsj" />
								<ext:StringFilter DataIndex="hddb" />
								<ext:StringFilter DataIndex="zzzj" />
								<ext:StringFilter DataIndex="wsgs" />
								<ext:StringFilter DataIndex="ycws" />
								<ext:StringFilter DataIndex="scws" />
								<ext:StringFilter DataIndex="rs" />
								<ext:StringFilter DataIndex="wjrs" />
								<ext:StringFilter DataIndex="kssl" />
								<ext:StringFilter DataIndex="ssdq" />
								<ext:StringFilter DataIndex="mzrs" />
								<ext:StringFilter DataIndex="chmzs" />
								<ext:StringFilter DataIndex="ncys" />
								<ext:StringFilter DataIndex="chcys" />
								<ext:StringFilter DataIndex="nsr" />
								<ext:StringFilter DataIndex="chnsr" />
								<ext:StringFilter DataIndex="sblx" />
								<ext:StringFilter DataIndex="pzlx" />
								<ext:StringFilter DataIndex="pybm" />
								<ext:StringFilter DataIndex="wbbm" />
								<ext:StringFilter DataIndex="qtbm" />

                                </Filters>
                            </ext:GridFilters>
                        </Plugins>
                        <LoadMask ShowMask="true" Msg="正在加载..." />
                        <SelectionModel>
                            <ext:CheckboxSelectionModel ID="CheckBoxGrid" runat="server" />
                        </SelectionModel>
                        <BottomBar>
                            <ext:PagingToolbar ID="PagingToolBar" StoreID="d1011_MainStore" PageSize="15" runat="server" />
                        </BottomBar>
                    </ext:GridPanel>
                </Items>
            </ext:FitLayout>
        </Items>
    </ext:Viewport>
    
    <!--d1011表修改，添加主窗体-->
    <ext:Window ID="d1011_Win" Collapsible="true" Hidden="true" Modal="true"
        Maximizable="true" runat="server" Title="添加/修改记录" Icon="WorldEdit" Width="630" AutoHeight="true"
        Resizable="true">
        <Items>
            <ext:Hidden ID="Hid" runat="server">
            </ext:Hidden>
            <ext:FormPanel ID="d1011_MainForm" LabelWidth="65" Frame="true" runat="server"
                Border="false" Height="510" Padding="5" Icon="UserAdd" Layout="Column">
                <Items>
                    <ext:Panel runat="server" Border="false" Header="false" ColumnWidth=".5" Layout="Form">
                        <Items>
                            
							<ext:TextField ID="Txtjgmc" AnchorHorizontal="92%" runat="server" AllowBlank="false" EmptyText="该项不可为空" FieldLabel="jgmc" />
							<ext:TextField ID="Txtdsgx" AnchorHorizontal="92%" runat="server" AllowBlank="false" EmptyText="该项不可为空" FieldLabel="dsgx" />
							<ext:TextField ID="Txtjjlx" AnchorHorizontal="92%" runat="server" AllowBlank="false" EmptyText="该项不可为空" FieldLabel="jjlx" />
							<ext:TextField ID="Txtjgjb" AnchorHorizontal="92%" runat="server" AllowBlank="false" EmptyText="该项不可为空" FieldLabel="jgjb" />
							<ext:TextField ID="Txttsdz" AnchorHorizontal="92%" runat="server" AllowBlank="false" EmptyText="该项不可为空" FieldLabel="tsdz" />
							<ext:TextField ID="Txtdhhm" AnchorHorizontal="92%" runat="server" AllowBlank="false" EmptyText="该项不可为空" FieldLabel="dhhm" />
							<ext:TextField ID="Txtclsj" AnchorHorizontal="92%" runat="server" AllowBlank="false" EmptyText="该项不可为空" FieldLabel="clsj" />
							<ext:TextField ID="Txtzzzj" AnchorHorizontal="92%" runat="server" AllowBlank="false" EmptyText="该项不可为空" FieldLabel="zzzj" />
							<ext:TextField ID="Txtycws" AnchorHorizontal="92%" runat="server" AllowBlank="false" EmptyText="该项不可为空" FieldLabel="ycws" />
							<ext:TextField ID="Txtrs" AnchorHorizontal="92%" runat="server" AllowBlank="false" EmptyText="该项不可为空" FieldLabel="rs" />
							<ext:TextField ID="Txtkssl" AnchorHorizontal="92%" runat="server" AllowBlank="false" EmptyText="该项不可为空" FieldLabel="kssl" />
							<ext:TextField ID="Txtmzrs" AnchorHorizontal="92%" runat="server" AllowBlank="false" EmptyText="该项不可为空" FieldLabel="mzrs" />
							<ext:TextField ID="Txtncys" AnchorHorizontal="92%" runat="server" AllowBlank="false" EmptyText="该项不可为空" FieldLabel="ncys" />
							<ext:TextField ID="Txtnsr" AnchorHorizontal="92%" runat="server" AllowBlank="false" EmptyText="该项不可为空" FieldLabel="nsr" />
							<ext:TextField ID="Txtsblx" AnchorHorizontal="92%" runat="server" AllowBlank="false" EmptyText="该项不可为空" FieldLabel="sblx" />
							<ext:TextField ID="Txtpybm" AnchorHorizontal="92%" runat="server" AllowBlank="false" EmptyText="该项不可为空" FieldLabel="pybm" />
							<ext:TextField ID="Txtqtbm" AnchorHorizontal="92%" runat="server" AllowBlank="false" EmptyText="该项不可为空" FieldLabel="qtbm" />

                        </Items>
                    </ext:Panel>
                    <ext:Panel runat="server" Border="false" Header="false" ColumnWidth=".5" Layout="Form">
                        <Items> 
                            
							<ext:TextField ID="Txtzjdm" AnchorHorizontal="92%" runat="server" AllowBlank="false" EmptyText="该项不可为空" FieldLabel="zjdm" />
							<ext:TextField ID="Txtzpdw" AnchorHorizontal="92%" runat="server" AllowBlank="false" EmptyText="该项不可为空" FieldLabel="zpdw" />
							<ext:TextField ID="Txtjglb" AnchorHorizontal="92%" runat="server" AllowBlank="false" EmptyText="该项不可为空" FieldLabel="jglb" />
							<ext:TextField ID="Txtshyl" AnchorHorizontal="92%" runat="server" AllowBlank="false" EmptyText="该项不可为空" FieldLabel="shyl" />
							<ext:TextField ID="Txtyzbm" AnchorHorizontal="92%" runat="server" AllowBlank="false" EmptyText="该项不可为空" FieldLabel="yzbm" />
							<ext:TextField ID="Txtdzyx" AnchorHorizontal="92%" runat="server" AllowBlank="false" EmptyText="该项不可为空" FieldLabel="dzyx" />
							<ext:TextField ID="Txthddb" AnchorHorizontal="92%" runat="server" AllowBlank="false" EmptyText="该项不可为空" FieldLabel="hddb" />
							<ext:TextField ID="Txtwsgs" AnchorHorizontal="92%" runat="server" AllowBlank="false" EmptyText="该项不可为空" FieldLabel="wsgs" />
							<ext:TextField ID="Txtscws" AnchorHorizontal="92%" runat="server" AllowBlank="false" EmptyText="该项不可为空" FieldLabel="scws" />
							<ext:TextField ID="Txtwjrs" AnchorHorizontal="92%" runat="server" AllowBlank="false" EmptyText="该项不可为空" FieldLabel="wjrs" />
							<ext:TextField ID="Txtssdq" AnchorHorizontal="92%" runat="server" AllowBlank="false" EmptyText="该项不可为空" FieldLabel="ssdq" />
							<ext:TextField ID="Txtchmzs" AnchorHorizontal="92%" runat="server" AllowBlank="false" EmptyText="该项不可为空" FieldLabel="chmzs" />
							<ext:TextField ID="Txtchcys" AnchorHorizontal="92%" runat="server" AllowBlank="false" EmptyText="该项不可为空" FieldLabel="chcys" />
							<ext:TextField ID="Txtchnsr" AnchorHorizontal="92%" runat="server" AllowBlank="false" EmptyText="该项不可为空" FieldLabel="chnsr" />
							<ext:TextField ID="Txtpzlx" AnchorHorizontal="92%" runat="server" AllowBlank="false" EmptyText="该项不可为空" FieldLabel="pzlx" />
							<ext:TextField ID="Txtwbbm" AnchorHorizontal="92%" runat="server" AllowBlank="false" EmptyText="该项不可为空" FieldLabel="wbbm" />

                        </Items>
                    </ext:Panel>
                </Items>
            </ext:FormPanel>
        </Items>
        <Buttons> 
            <ext:Button Text="提交" ID="BtnSave" runat="server" Icon="Disk">
                <DirectEvents>
                    <Click OnEvent="BtnSave_Click">
                        <EventMask ShowMask="true" Msg="正在提交，请等候 ..."  />
                    </Click>
                </DirectEvents>
                <Listeners>
                    <Click Handler="if (#{d1011_MainForm}.getForm().isValid()) {;}else{Ext.Msg.show({icon: Ext.MessageBox.ERROR, msg: '您填写的信息不正确，请您确认！', buttons:Ext.Msg.OK});return false;}" />
                </Listeners>
            </ext:Button>
            <ext:Button Text="取消" ID="BtnConcel" Icon="Delete">
                <Listeners>
                    <Click Handler="#{d1011_Win}.hide();" />
                </Listeners>
            </ext:Button>
        </Buttons>
    </ext:Window>
    </form>
</body>
</html>
